const Koa = require('koa')
const app = new Koa()

//初始化数据库
const config = require('./conf')
const {loadModel} = require('./framework/loader')
loadModel(config)(app)

const restful = require('./framework/router')
const bodyParser = require('koa-bodyparser')
app.use(bodyParser())
app.use(require('koa-static')(__dirname + '/'))
app.use(restful)




const port = 3000
app.listen(port,()=>{
    console.log(`app start at port ${port}...`)
})